package com.chartHandle.bean;

import lombok.Data;

import java.util.Objects;

@Data
public class PointXY {
    private int x;
    private int y;

    public PointXY(int x, int y) {
        this.x = x;
        this.y = y;
    }

    // 这俩方法得重写，要不然在map中根据 xy的坐标找不到对应的数据
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PointXY pointXY = (PointXY) o;
        return x == pointXY.x &&
                y == pointXY.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
}
